import Vue from 'vue'
import VueRouter from 'vue-router'
import layout from '@/layout/index.vue'
Vue.use(VueRouter)

// 首页
const firstPage = '/home'

const routes = [
  {
    path: 'home',
    name: '首页',
    component: () => import('@/views/home')
  },
  {
    path: 'setting',
    name: '设置',
    component: () => import('@/views/setting.vue')
  },
  {
    path: 'opt',
    name: '隐藏的页面',
    hidden:true,
    component: () => import('@/views/opt.vue')
  },
]
const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes:[
    {
      path: '/',
      redirect:firstPage,
      name: 'layout',
      component: layout,
      children:routes
    },
  ]
})

export default router
